package fschmidt.util.servlet;

import org.eclipse.jetty.http.HttpContent;
import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.util.resource.Resource;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Enumeration;

public class NoCacheDefaultServlet extends DefaultServlet {

	protected void sendData(HttpServletRequest request,
							HttpServletResponse response,
							boolean include,
							Resource resource,
							HttpContent content,
							Enumeration reqRanges)
			throws IOException
	{
		response.setHeader("Cache-Control", "max-age=0");
		super.sendData(request, response, include, resource, content, reqRanges);
	}

}
